package com.daedalus.Gui.textFields;

/**
 * Created by IntelliJ IDEA.
 * Author: Kostika Gorica
 */
import java.awt.event.*;
import javax.swing.*;

public class textFieldsAbsolutePosition extends JPanel implements ActionListener{

	JLabel fushaLabel;
	JTextField fushaNdr, fushaJoNdr;
	JButton buton;

	public textFieldsAbsolutePosition(){

		setSize(400,300);
		setLayout(null);

		fushaLabel =new JLabel("Fusha 1");
		fushaLabel.setSize(100, 30);
		fushaLabel.setLocation(20, 20);
		add(fushaLabel);

		fushaNdr =new JTextField();
		fushaNdr.setSize(200, 30);
		fushaNdr.setLocation(140, 20);
		add(fushaNdr);

		fushaJoNdr =new JTextField("Fushe e pandryshueshme");
		fushaJoNdr.setSize(300, 30);
		fushaJoNdr.setLocation(20, 70);
		fushaJoNdr.setEditable(false);
		add(fushaJoNdr);

		buton =new JButton("Kopjo fushen");
		buton.setSize(250, 40);
		buton.setLocation(80, 130);
		add(buton);

		buton.addActionListener(this);
	}





	public static void main(String[] args){
		textFieldsAbsolutePosition p=new textFieldsAbsolutePosition();
		JFrame frame= new JFrame("textFieldsAbsolutePosition Grafike");
		frame.setSize(400, 300);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.add(p);
		frame.setVisible(true);
	}

    @Override
    public void actionPerformed(ActionEvent e) {
        if(e.getSource()== buton) {
            String txt= fushaNdr.getText();
            fushaJoNdr.setText(txt);
        }
    }
}	// mbyll klasen textFieldsAbsolutePosition

